/* ranking.html 专用样式 - 简洁白色风格 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', 'Microsoft YaHei', sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    padding: 20px;
}

/* 导航栏 */
.navbar {
    background: white;
    padding: 15px 30px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.navbar h1 {
    color: #333;
    font-size: 24px;
    font-weight: 500;
}

.navbar .nav-links {
    display: flex;
    gap: 20px;
}

.navbar a {
    color: #666;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 4px;
    transition: all 0.3s;
    font-size: 15px;
}

.navbar a:hover {
    background: #f5f5f5;
    color: #333;
}

.navbar .user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.navbar .username {
    color: #333;
    font-weight: 500;
}

.navbar button {
    background: #333;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.navbar button:hover {
    background: #000;
}

/* 主容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.container h2 {
    color: #333;
    font-size: 28px;
    font-weight: 500;
    margin-bottom: 10px;
}

/* 排行榜表格 */
.ranking-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.ranking-table thead {
    background: #fafafa;
    border-bottom: 2px solid #e5e5e5;
}

.ranking-table th {
    padding: 15px 12px;
    text-align: center;
    color: #666;
    font-weight: 500;
    font-size: 14px;
}

.ranking-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.ranking-table tbody tr:hover {
    background: #fafafa;
}

.ranking-table td {
    padding: 15px 12px;
    text-align: center;
    color: #333;
    font-size: 15px;
}

.ranking-table td:nth-child(2) {
    text-align: left;
}

/* 排名列样式 */
.rank-medal {
    font-size: 20px;
    font-weight: 500;
}

/* 高亮当前用户 */
.ranking-table tr[style*="background: #ffffcc"] {
    background: #fffbeb !important;
}

.ranking-table tr[style*="background: #ffffcc"]:hover {
    background: #fef3c7 !important;
}

/* 加载和错误提示 */
#rankingContent p {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 15px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
    }

    .navbar h1 {
        font-size: 20px;
    }

    .navbar .nav-links {
        width: 100%;
        justify-content: center;
    }

    .navbar .user-info {
        width: 100%;
        justify-content: center;
    }

    .container {
        padding: 25px 20px;
    }

    .container h2 {
        font-size: 24px;
    }

    .ranking-table {
        font-size: 14px;
    }

    .ranking-table th,
    .ranking-table td {
        padding: 10px 8px;
    }

    .rank-medal {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .ranking-table th:nth-child(4),
    .ranking-table td:nth-child(4) {
        display: none; /* 小屏幕隐藏提交数 */
    }
    
    .ranking-table th,
    .ranking-table td {
        padding: 10px 5px;
        font-size: 13px;
    }
}